bitkeeper revision 1.1159.1.365 (418a0a91qNKrNOnOWtCM1nF1-HmNrA)
authoriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>
Thu, 4 Nov 2004 10:55:13 +0000 (10:55 +0000)
committeriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>
Thu, 4 Nov 2004 10:55:13 +0000 (10:55 +0000)
change readline to _readline to keep Twisted happy,

tools/python/xen/sv/Daemon.py
tools/python/xen/xend/Blkctl.py
tools/python/xen/xend/server/SrvDaemon.py
tools/python/xen/xend/server/blkif.py

index 510cfa9f04f8eaa9d993c6ce0a017ee6c6e9a60b..5a8d18e5e4b26fbc422ece343bddffc4b838a1d2 100644 (file)
@@ -15,6 +15,8 @@ from xen.sv.params import *
 from twisted.internet import reactor
 from twisted.web import static, server, script
 
+from xen.util.ip import _readline, _readlines
+
 class Daemon:
     """The xend daemon.
     """
@@ -57,7 +59,7 @@ class Daemon:
             return 0
         # Read the pid of the previous invocation and search active process list.
         pid = open(PID_FILE, 'r').read()
-        lines = os.popen('ps ' + pid + ' 2>/dev/null').readlines()
+        lines = _readlines(os.popen('ps ' + pid + ' 2>/dev/null'))
         for line in lines:
             if re.search('^ *' + pid + '.+xensv', line):
                 if not kill:
index a5bda1947034bd4845952c2427c21c1d71691690..d90c7ce51df0981487eeab447046543499c728af 100644 (file)
@@ -6,6 +6,9 @@ import sys
 import string
 
 from xen.xend import XendRoot
+
+from xen.util.ip import _readline, _readlines
+
 xroot = XendRoot.instance()
 
 """Where network control scripts live."""
@@ -37,6 +40,6 @@ def block(op, type, dets, script=None):
     args = ' '.join(args)
     out = os.popen(script + ' ' + args)
 
-    output = out.readline()
+    output = _readline(out)
     out.close()
     return string.rstrip(output)
index 41a5965221734f811f373c52825446a40eb7e559..05a0f27201dc453b02e5cb6f68cd3da5351703c8 100644 (file)
@@ -35,6 +35,8 @@ from xen.xend.server import SrvServer
 from xen.xend import XendRoot
 from xen.xend.XendLogging import log
 
+from xen.util.ip import _readline, _readlines
+
 import channel
 import blkif
 import netif
@@ -382,7 +384,7 @@ class Daemon:
         """
         running = 0
         if pid:
-            lines = os.popen('ps %d 2>/dev/null' % pid).readlines()
+            lines = _readlines(os.popen('ps %d 2>/dev/null' % pid))
             exp = '^ *%d.+%s' % (pid, name)
             for line in lines:
                 if re.search(exp, line):
index 9ca8eab5fe02b51de71dd3f9c46f70ca895c5506..1e06c55345dc898389475a43e49f4940edfb4838 100755 (executable)
@@ -16,6 +16,8 @@ import channel
 import controller
 from messages import *
 
+from xen.util.ip import _readline, _readlines
+
 def expand_dev_name(name):
     if re.match( '^/dev/', name ):
        return name
@@ -25,7 +27,7 @@ def expand_dev_name(name):
 def check_mounted(self, name):
     mode = None
     name = expand_dev_name(name)
-    lines = os.popen('mount 2>/dev/null').readlines()
+    lines = _readlines(os.popen('mount 2>/dev/null'))
     exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
     for line in lines:
         pm = exp.match(line)